package com.vhall.component.dao.account;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.vhall.component.entity.account.AdminsEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * @author dalong
 * @date 2021-05-19 20:50
 */
@Mapper
@Repository
public interface AccountAdminsMapper extends BaseMapper<AdminsEntity> {

    /**
     * 查询管理员数（admin）
     *
     * @param queryWrapper 查询条件
     * @return 管理员数
     */
    @Select("select count(*) from admins left join role ON admins.role_id = role.role_id ${ew.customSqlSegment}")
    Integer countForAdmin(@Param(Constants.WRAPPER) Wrapper<Object> queryWrapper);

}
